<?php
/**
 * Created by PhpStorm.
 * User: helinjin
 * Date: 17/2/28
 * Time: 下午4:24
 */

namespace appmy\admin\controller;

class Exam extends Common
{
    public function index()
    {
        return $this->fetch();
    }

    public function insert(){
        $data = input('post.');
       // var_dump($data);

        $id = db('content')->insertGetId($data);

        if($id)
        {
            $result['info'] = '习题添加成功!';
            $result['url'] = url('index');
            $result['status'] = 1;

           // var_dump($result);

            return $result;
        }
        else
        {
            $result['info'] = '习题添加失败!';
            $result['status'] = 0;
            return $result;
        }
    }
}